package com.zhangyx.crawler.comm;

import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.Date;

public class ConvertUtil {
    public static String URLEncode(String data) {
        String ret = "";
        try {
            ret = URLEncoder.encode(data, "utf-8");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return ret;

    }

    /**
     * 2017-09-13 12:12:00
     * @return
     */
    public static String getNowTime() {
        Date date = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        return sdf.format(date);
    }
}
